import java.util.Scanner;

public class Main1 {
    //洗牌
    public static void shuffle(int[] arr, int k) {
        int n = arr.length / 2;
        for (int i = 0; i < k; i++) {
            int[] newArr = new int[2 * n];
            for (int j = 0; j < n; j++) {
                newArr[2 * j] = arr[j];
                newArr[2 * j + 1] = arr[j + n];
            }
            arr = newArr;
        }
        for (int j = 0; j < 2 * n - 1; j++) {
            System.out.print(arr[j] + " ");
        }
        System.out.println(arr[2 * n - 1]);
    }


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        //x组数据
        int x = scanner.nextInt();
        for (int i = 0; i < x; i++) {
            int n = scanner.nextInt();//会有2n个数据
            int k = scanner.nextInt();//洗几次
            int[] arr = new int[2 * n];
            for (int j = 0; j < 2 * n; j++) {
                arr[j] = scanner.nextInt();
            }
            shuffle(arr, k);

        }
        scanner.close();
    }
}